Title: Custom Field: Years Role Playing v1.1

Author: John Briggs

Description:
This modification will provide an additonal field.
The additional field can be entered on your member registration form.
The additonal field is editable in your member control panel and admin edit profile tool.
The additonal field is displayed in your member profile and threads.

Compatability: XMB 1.9.5 SP1

Install Note: Before adding this modification to your forum, you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Note: Backup all affected files, templates and database.

Affected Files (5): editprofile.php, member.php, memcp.php, viewthread.php, lang/English.lang.php

Affected Templates (5): admintool_editprofile, member_profile, member_reg, memcp_profile, viewthread_post

Author Note:
You downloaded this modification from XMB Garage.
Please visit http://www.xmbgarage.com/ for support.

Copyright:  2009 John Briggs. All rights reserved.

=======================================================================================================================================
=======
Step 1:
=======

=======================================================================
Go to Admin Panel -> Insert Raw SQL -> Paste Code Below & Click Submit:
=======================================================================

ALTER TABLE `$table_members` ADD `years_role_playing` varchar(100) NOT NULL default '';

=======================================================================================================================================
=======
Step 2:
=======

=====================
Edit File: member.php
=====================

==========
Find Code:
==========

loadtemplates(

=================
Replace Code With:
=================

loadtemplates(
'member_profile_years_role_playing',

==========
Find Code:
==========

        $sig           = isset($sig) ? checkInput($sig, '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

        $years_role_playing = isset($years_role_playing) ? checkInput($years_role_playing, '', '', 'javascript', false) : '';

==========
Find Code:
==========

        $sig           = addslashes($sig);

===============
Add Code Below:
===============

        $years_role_playing = addslashes($years_role_playing);

==========
Find Code:
==========

        $db->query("INSERT INTO $table_members (uid,

=====================================
Find Code In-Line In Above Statement:
=====================================

) VALUES ('', '$username',

==================
Replace Code With:
==================

, years_role_playing) VALUES ('', '$username',

==========================================
Find Code At End Of Above Query Statement:
==========================================

)");

==================
Replace Code With:
==================

, '$years_role_playing')");

==========
Find Code:
==========

            if ($memberinfo['email'] != "" && $memberinfo['showemail'] == "yes") {
                $email = $memberinfo['email'];
            } else {
                $email = '';
            }

===============
Add Code Below:
===============

            // create years_role_playing block
            $years_role_playingblock = '';
            if ($memberinfo['years_role_playing'] != '') {
                $memberinfo['years_role_playing'] = censor($memberinfo['years_role_playing']);
                eval('$years_role_playingblock = "'.template('member_profile_years_role_playing').'";');
            }

=======================================================================================================================================
=======
Step 3:
=======

====================
Edit File: memcp.php
====================

==========
Find Code:
==========

        $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

        $years_role_playing = isset($years_role_playing) ? checkInput($years_role_playing, '', '', 'javascript', false) : '';

==========
Find Code:
==========

        $sig            = addslashes($sig);

===============
Add Code Below:
===============

        $years_role_playing = addslashes($years_role_playing);

==========
Find Code:
==========

$db->query("UPDATE $table_members SET $pwtxt email='$email',

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

 WHERE username='$xmbuser'");

==================
Replace Code With:
==================

, years_role_playing='$years_role_playing' WHERE username='$xmbuser'");

=======================================================================================================================================
=======
Step 4:
=======

==========================
Edit File: editprofile.php
==========================

==========
Find Code:
==========

    $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

    $years_role_playing = isset($years_role_playing) ? checkInput($years_role_playing, '', '', 'javascript', false) : '';

==========
Find Code:
==========

    $sig            = addslashes($sig);

===============
Add Code Below:
===============

    $years_role_playing = addslashes($years_role_playing);

==========
Find Code:
==========

$db->query("UPDATE $table_members SET email='$email',

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

 WHERE username='$user'");

==================
Replace Code With:
==================

, years_role_playing='$years_role_playing' WHERE username='$user'");

=======================================================================================================================================
=======
Step 5:
=======

=========================
Edit File: viewthread.php
=========================

==========
Find Code:
==========

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

===============
Add Code Below:
===============

            $years_role_playing = '';
            if ($post['years_role_playing'] != '') {
                $post['years_role_playing'] = censor($post['years_role_playing']);
                $years_role_playing = '<br /><strong>'.$lang['years_role_playing'].'</strong> '.$post['years_role_playing'];
            }

==========
Find Code:
==========

            $u2u = '';
            $location = '';
            $mood = '';

===============
Add Code Below:
===============

            $years_role_playing = '';

=======================================================================================================================================
=======
Step 6:
=======

================================
Edit File: lang/English.lang.php
================================

================================
Add Code At Very Bottom Of File:
================================

// Custom Field: Years Role Playing Mod Begin
$lang['years_role_playing'] = "Number of Years Role Playing:";
// Custom Field: Years Role Playing Mod End

=======================================================================================================================================
=======
Step 7:
=======

=======================================================
Go To Admin Panel -> Templates -> admintool_editprofile
=======================================================

==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[textlocation]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newmemlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[years_role_playing]</td>
<td bgcolor="$altbg2"><input type="text" name="years_role_playing" size="25" value="$member[years_role_playing]" /></td>
</tr>

=======================================================================================================================================
=======
Step 8:
=======

============================================
Go To Admin Panel -> Templates -> member_reg
============================================

==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textlocation]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="locationnew" size="25" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[years_role_playing]</td>
<td bgcolor="$altbg2"><input type="text" name="years_role_playing" size="25" value="" /></td>
</tr>

=======================================================================================================================================
=======
Step 9:
=======

===============================================
Go To Admin Panel -> Templates -> memcp_profile
===============================================

==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" width="22%" class="tablerow">$lang[textlocation]</td>
<td bgcolor="$altbg2" class="tablerow"><input type="text" name="newmemlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[years_role_playing]</td>
<td bgcolor="$altbg2"><input type="text" name="years_role_playing" size="25" value="$member[years_role_playing]" /></td>
</tr>

=======================================================================================================================================
========
Step 10:
========

=================================================
Go To Admin Panel -> Templates -> viewthread_post
=================================================

==========
Find Code:
==========

$location

===============
Add Code Below:
===============

$years_role_playing

=======================================================================================================================================
========
Step 11:
========

================================================
Go To Admin Panel -> Templates -> member_profile
================================================

==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow">$lang[textlocation]</td>
<td bgcolor="$altbg2" class="tablerow">$memberinfo[location]</td>
</tr>

===============
Add Code Below:
===============

$years_role_playingblock

=============================================
Go To Admin Panel -> Templates
Create New Template: member_profile_years_role_playing
====================================

===================
Add Code and Submit:
===================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[years_role_playing]</td>
<td bgcolor="$altbg2">$memberinfo[years_role_playing]</td>
</tr>

=======================================================================================================================================